<template>
<div>
  <el-form :model="form" label-position="left" label-width="80px">
    <el-form-item label="职位名称">
      <el-input v-model="form.name"/>
    </el-form-item>
    <el-form-item label="薪资">
      <el-input v-model="form.salary"/>
    </el-form-item>
    <el-form-item label="工作地点">
      <el-input v-model="form.location"/>
    </el-form-item>
    <el-form-item label="公司名称">
      <el-input v-model="form.companyName"/>
    </el-form-item>
    <el-form-item label="学历要求">
      <el-select  placeholder="请选择" v-model="form.degree">
        <el-option label="无" value="无"></el-option>
        <el-option label="高中" value="高中"></el-option>
        <el-option label="本科" value="本科"></el-option>
        <el-option label="研究生" value="研究生"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="标签">
      <el-row type="flex">
        <el-input v-model="tag_input"></el-input><el-button type="primary" @click="addtag">添加标签</el-button>
      </el-row>
      <el-row type="flex">
        <el-tag closable v-for="i in form.tags" @close="tagDelete(i)" v-if="!(i.id&&i.tagsId==null)">{{i.tag}}</el-tag>
      </el-row>
    </el-form-item>
  </el-form>
</div>
</template>

<script>
export default {
  name: "jobform",
  data(){
    return{
      tag_input:''
    }
  },
  props:{
    form:{
      type:Object
    }
  },
  methods:{
    addtag(){
      this.form.tags.push({tag:this.tag_input})
    },
    tagDelete(tag){
      this.$set(tag,'tagsId',null)
    }
  }
}
</script>

<style scoped>

</style>